gtktreeview: Transform cell area to widget coordinates
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 6 Oct 2017 16:12:03 +0000 (18:12 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 6 Oct 2017 16:26:08 +0000 (18:26 +0200)
GtkCellArea uses event coordinates (thus in treeview relative
coordinates), but calculations used to happen in bin window coords.
We can just offset the cell area by the bin window, fixes cell
renderer activation and edition.

gtk/gtktreeview.c

index 315a5d7ade77eb978d969d6a4281bbf277524346..2bb539cc0e2eb32395f16a07a4efa7f6dc6b5617 100644 (file)
@@ -2900,6 +2900,12 @@ gtk_tree_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
   background_area.height = gtk_tree_view_get_row_height (tree_view, node);
   background_area.x = 0;
 
+  gtk_tree_view_convert_bin_window_to_widget_coords (tree_view,
+                                                     background_area.x,
+                                                     background_area.y,
+                                                     &background_area.x,
+                                                     &background_area.y);
+
   /* Let the column have a chance at selecting it. */
   rtl = (_gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL);
   for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns));